package com.slg.android.manyanime.bean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Thinkpad on 2015/3/11.
 */
public class CartoonNewest {
    //    "id": "100032549",
//            "name": "super少女",
//            "update_time": "2015-03-11",
//            "isOver": "0",
//            "cover": "http://shp.qpic.cn/manhua_cover/0/04_09_28_82e87d78ab0dcee9c7eede13c5fb77ca.jpg/0",
//            "lastup": "27话",
//            "area": "内地",
//            "category": "故事 校园",
//            "score": "4"

//    {
//        "id": "100000001",
//            "name": "尸兄",
//            "update_time": "1425983408",
//            "lastup": "130话",
//            "isOver": "0",
//            "cover": "http://shp.qpic.cn/manhua_cover/0/21_17_29_35e997edcb17f23221abf0154cfe40e8.jpg/0",
//            "artist": "七度魚",
//            "intro": "即将毁灭的世界......每周五更新...",
//            "ios_delete": "1",
//            "area": "内地",
//            "category": "故事 恐怖",
//            "score": "4.5"
//    },
    private String id;
    private String name;
    private String update_time;
    private int isOver;
    private String cover;
    private String lastup;
    private String area;
    private String category;
    private double score;

    private String artist;
    private String  intro;
    private int ios_delete;

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public int getIos_delete() {
        return ios_delete;
    }

    public void setIos_delete(int ios_delete) {
        this.ios_delete = ios_delete;
    }

    public void parseJson(JSONObject jsonObject) {


        try {
            id = jsonObject.getString("id");
            name = jsonObject.getString("name");
            update_time = jsonObject.getString("update_time");
            isOver = jsonObject.getInt("isOver");
            cover = jsonObject.getString("cover");
            lastup = jsonObject.getString("lastup");
            area = jsonObject.getString("area");
            category = jsonObject.getString("category");
            score = jsonObject.getDouble("score");

            artist=jsonObject.optString("artist");
            intro=jsonObject.optString("intro");
            ios_delete=jsonObject.optInt("ios_delete");


        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public int getIsOver() {
        return isOver;
    }

    public void setIsOver(int isOver) {
        this.isOver = isOver;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getLastup() {
        return lastup;
    }

    public void setLastup(String lastup) {
        this.lastup = lastup;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public boolean equals(Object o) {

        if (o instanceof CartoonNewest) {
            CartoonNewest cate = (CartoonNewest) o;
            if (cate.getId().equals(this.id)) {
                return true;
            }
        }
        return false;
    }

}
